import { Link } from 'umi';

const columns = [
  {
    title: '机构名称',
    key: 'name',
    dataIndex: 'name'
  },
  {
    title: '机构编号',
    key: 'unitNo',
    dataIndex: 'unitNo'
  },
  {
    title: '机构类型',
    key: 'typeName',
    dataIndex: 'typeName'
  },
  {
    title: '学校类型',
    key: 'schoolTypeName',
    dataIndex: 'schoolTypeName'
  },
  {
    title: '所属市',
    key: 'city',
    dataIndex: 'city',
    align: 'center'
  },
  {
    title: '所属区县',
    key: 'county',
    dataIndex: 'county',
    align: 'center'
  },
  {
    title: '借阅利用册数',
    key: 'useQuantity',
    dataIndex: 'useQuantity',
    align: 'center',
    sorter: (a, b) => a.useQuantity - b.useQuantity
  },
  {
    title: '馆藏数',
    key: 'revTotal',
    dataIndex: 'revTotal',
    align: 'center',
    sorter: (a, b) => a.revTotal  - b.revTotal 
  },
  {
    title: '图书利用率',
    key: 'rate',
    dataIndex: 'rate',
    align: 'center',
    sorter: (a, b) => a.rate - b.rate 
  },
  {
    title: '操作',
    key: 'operation',
    fixed: 'right',
    align: 'center',
    render: (text, record) => (
      <Link to={{pathname:"/statistics/flow/utilization/detail", state: {...record}}}>详情</Link>
    )
  }
]

export default columns